//
//  CustomPopOverView.h
//  gongchengjia
//
//  Created by HXHL-wally on 16/6/14.
//  Copyright © 2016年 鸿鑫互联－wally. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, CPAlignStyle) {
    CPAlignStyleCenter,
    CPAlignStyleLeft,
    CPAlignStyleRight,
};

// 小三角的高度
#define kTriangleHeight 8.0

// 小三角的宽度
#define kTriangleWidth 10.0

// 弹出视图背景的圆角半径
#define kPopOverLayerCornerRadius 5.0

// 调整弹出视图背景四周的空隙
#define kRoundMargin 2.0

@class CustomPopOverView;
@protocol CustomPopOverViewDelegate <NSObject>

@optional
- (void)popOverViewDidShow:(CustomPopOverView *)pView;
- (void)popOverViewDidDismiss:(CustomPopOverView *)pView;

// for normal use
// 普通用法（点击菜单）的回调
- (void)popOverView:(CustomPopOverView *)pView didClickMenuIndex:(NSInteger)index titles:(NSString * )title;

@end


@interface CustomPopOverView : UIView
// delegate
@property (nonatomic, weak) id<CustomPopOverViewDelegate>  delegate;

// you can set custom view or custom viewController
@property (nonatomic, strong) UIView *content;
// 
@property (nonatomic, strong) UIViewController *contentViewController;
// backgroudColor
@property (nonatomic, strong) UIColor *containerBackgroudColor;

@property (nonatomic, strong) NSString * titles;

+ (instancetype)popOverView;
//  位置 TableviewCell(高度 title 图标 字体大小 颜色)
- (instancetype)initWithBounds:(CGRect) bounds
                             Row_Height:(CGFloat) row_Height
                             TitleMenus:(NSArray *) titles
                                 Images:(NSArray *) images
                               FontSize:(CGFloat) fontSize
                             TitleColor:(UIColor *) titleColor;

- (void)showFrom:(UIView *)from alignStyle:(CPAlignStyle)style;

- (void)dismiss;

@end
